package com.mofang.powerdekorhelper.adapter;

import android.content.Context;
import android.text.TextUtils;

import com.mofang.powerdekorhelper.R;
import com.mofang.powerdekorhelper.base.recycleview.BaseRecycleViewAdapter;
import com.mofang.powerdekorhelper.base.recycleview.BaseViewHolder;
import com.mofang.powerdekorhelper.model.CardShop;

import java.util.List;

/**
 * Created by yml on 2016/12/27.
 */

public class CardShopAdapter extends BaseRecycleViewAdapter {

    public CardShopAdapter(List<?> data, Context mContext, int layoutId) {
        super(data, mContext, layoutId);
    }

    @Override
    protected <T> void convert(BaseViewHolder holder, T bean, int position) {
        CardShop.CardShopData data = (CardShop.CardShopData) bean;
        if (!TextUtils.isEmpty(data.getAddress())) {
            holder.setText(R.id.card_shop_item_phone, data.getAddress());
        }
        if (!TextUtils.isEmpty(data.getShop_name())) {
            holder.setText(R.id.card_shop_item_address, data.getShop_name());
        }
    }
}
